import request from '@/utils/request'

// 新增公告
export const addAnnouncementService = (announcementAddDTO) => {
  return request.post('/admin/announcement/add', announcementAddDTO)
}

// 查询所有公告
export const listAllAnnouncementService = () => {
  return request.get('/admin/announcement/list')
}

// 根据公告id查询公告信息
export const getAnnouncementByIdService = (id) => {
  return request.get(`/admin/announcement/${id}`)
}

// 修改公告信息
export const updateAnnouncementService = (announcementUpdateDTO) => {
  return request.put('/admin/announcement', announcementUpdateDTO)
}

// 删除公告
export const deleteAnnouncementService = (id) => {
  return request.delete(`/admin/announcement/${id}`)
}
